<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>css/styles.css" media="screen" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
//<![CDATA[
	var map;
	var marker1;
function initialize() {
	<?php foreach($data as $row): ?>
	var latlng =  new google.maps.LatLng(<?php echo $row->latitude?>,<?php echo $row->longitude?>);
    var myOptions = {
      zoom: 13,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas3"),myOptions);
	
	
	var marker<?php echo $row->id_place?> = new google.maps.Marker({
		position: new google.maps.LatLng(<?php echo $row->latitude?>,<?php echo $row->longitude?>), 
		map: map,
		title:"<?php echo "Double click to see detail map ".$row->name?>"
	});
	
	var contentString<?php echo $row->id_place?> = '<div class="placename"><b><?php echo $row->name?></b></div>';
		
	var infowindow<?php echo $row->id_place?> = new google.maps.InfoWindow({
		content: contentString<?php echo $row->id_place?>,
		maxWidth :300,
		Height :40
	});
	
	google.maps.event.addListener(marker<?php echo $row->id_place?>, 'click', function() {
		infowindow<?php echo $row->id_place?>.open(map,marker<?php echo $row->id_place?>);
	});
	
	google.maps.event.addListener(map, "click", function(){
		infowindow<?php echo $row->id_place?>.close();
	});
	
	google.maps.event.addListener(marker<?php echo $row->id_place?>, 'dblclick', function() {
    map.setZoom(15);
	<?php endforeach;?>
  });
  
}
</script>
</head>

<body onload="initialize()">
		<div id="map_canvas3">
		</div>
</body>
</html>
			
<?php echo'';/*
var contentString<?php echo $row->id_place?> = '<div id="content">'+
			'<h1 id="firstHeading" class="firstHeading"><?php echo $row->name?></h1>'+
			'<div id="bodyContent">'+
			'<img src="<?php echo base_url()."img/".$row->foto_place?>" width="100" height="100">'+
			'<p><?php echo $row->description?><br>' +
			'<?php echo $row->street?><?php echo ', '.$row->city?><?php echo ', '.$row->state?><br>' +
			'</div>'+
		'</div>';
	var infowindow<?php echo $row->id_place?> = new google.maps.InfoWindow({
		content: contentString<?php echo $row->id_place?>,
		maxWidth :600
	});
	google.maps.event.addListener(marker<?php echo $row->id_place?>, 'click', function() {
		infowindow<?php echo $row->id_place?>.open(map,marker<?php echo $row->id_place?>);
	});
*/?>